import fetch from 'common/src/utils/fetch';

/**
 * 查询申请列表
 */
export function findItem(data) {
    return fetch({
        url:
            '/api/arrangementservice/professioncampusnum/findProfessionCampusNum',
        method: 'post',
        data
    });
}

/**
 * 查询申请详情
 */
export function selectApproFlow(id) {
    return fetch({
        url: '/api/workflow/approval/selectApproFlow',
        method: 'get',
        params: {
            no: id
        }
    });
}

/**
 * 增加专业与校区人数
 */
export function addItem(data) {
    return fetch({
        url:
            '/api/arrangementservice/professioncampusnum/addProfessionCampusNum',
        method: 'post',
        data
    });
}

/**
 * 删除专业与校区人数
 */
export function deleteItem(data) {
    return fetch({
        url:
            '/api/arrangementservice/professioncampusnum/deleteProfessionCampusNum',
        method: 'delete',
        data
    });
}

/**
 * 修改专业与校区人数
 */
export function updateItem(data) {
    return fetch({
        url:
            '/api/arrangementservice/professioncampusnum/updateProfessionCampusNum',
        method: 'put',
        data
    });
}

export function getOneById(id) {
    return fetch({
        url: '/api/arrangementservice/professioncampusnum/' + id,
        method: 'get'
    });
}

/**
 *
 * 学籍批量导入
 */
export function importCampus(calendarId) {
    return fetch({
        url:
            '/api/arrangementservice/professioncampusnum/importProfessionCampusNum?calendarId='+calendarId,
        method: 'get',
    });
}

/**
 * 修改专业与校区人数
 */
export function updateProCampusByIds(campus, data) {
    return fetch({
        url:
            '/api/arrangementservice/professioncampusnum/updateProCampusByIds?campus=' +
            campus,
        method: 'put',
        data
    });
}

/**
 * 查询异步导入状态
 */
export function getStatus(key) {
    return fetch({
        url:
            '/api/arrangementservice/professioncampusnum/findImportStatus?key='+key,
        method: 'get'
    });
}

/**
 * 查询申请列表
 */
export function findArrangeCampusNum(data) {
  return fetch({
      url:
          '/api/arrangementservice/professioncampusnum/findProfessionCampusNumByParam',
      method: 'post',
      data
  });
}
